home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / p_misc / netconf.arc / INTFACE.TXT < prev    next >
Text File  |  1988-12-10  |  19KB  |  464 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.           A Totally Awesome High-Speed Packet Radio I/O
  11.         Interface for the IBM PC XT/AT/386 and Macintosh
  12.                           II Computers
  13.  
  14.  
  15.                       Mike Chepponis, K3MC
  16.  
  17.                        Bernie Mans, AA4CG
  18.  
  19.  
  20.  
  21.                             _A_B_S_T_R_A_C_T
  22.  
  23.           This paper describes a plug-in  card  for  IBM  PC
  24.      XT/AT/386  compatible  computers or the Apple Macintosh
  25.      II  computer.   It  is  designed  to  handle   two   56
  26.      kilobit/sec  full-duplex  channels  via DMA and 10 slow
  27.      speed (19,200 bits/sec or less) channels via interrupts
  28.      without main processor intervention.  The board uses an
  29.      NEC V40 processor and up to six Zilog 85C30 Serial Com-
  30.      munication Controllers, together with either 256k bytes
  31.      of DRAM or 1 megabyte of DRAM to offload the main  pro-
  32.      cessor  from low-level interrupt fielding.  It communi-
  33.      cates with the main processor with an  8k  byte  memory
  34.      window  in the IBM version, and directly with Macintosh
  35.      II main memory using the  Bus  Master  concept  of  the
  36.      NuBus.   It  is  targeted at replacing existing TNCs in
  37.      the high-speed networks of  the  future;  special  con-
  38.      sideration  has  been  given  to the support of TCP/IP.
  39.      Even the  minimum  (easily  upgradable)  implementation
  40.      with  only  one  85C30  outperforms  all existing TNCs,
  41.      relying on the host PC only for  bootstrapping,  power,
  42.      and  of course, an effective user interface when called
  43.      for.
  44.  
  45.  
  46.  
  47. _H_i_s_t_o_r_y
  48.  
  49.      The history of packet radio  is  replete  with  ideas,  some
  50. great,  some not so great. One thing we did with this project was
  51. to survey the existing solutions for serial communications with a
  52. host  computer,  and to generate a solution that did not have any
  53. of the handicaps of previous methods.
  54.  
  55.      In the beginning, folks used TNCs, usually running code that
  56. expected  the  user  to attach a ``dumb'' terminal to them on one
  57. end, and to attach an AFSK 1200 baud Bell 202-compatible modem to
  58. an  ordinary  FM  radio  via  the external speaker and microphone
  59. jacks.
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.      When Phil Karn, KA9Q, wrote TCP/IP software for the  IBM  PC
  74. XT/AT (and it was subsequently ported to many different machines,
  75. including the Macintosh, Atari, UNIX [1],  and  Amiga),  he  ini-
  76. tially  used  ``nailed-up''  AX.25 connections, that is, ordinary
  77. TNCs in the Transparent  mode.   The  disadvantages  of  such  an
  78. approach was obvious to all of us, and a simplified TNC interface
  79. designed specifically for communicating with computers  (the  so-
  80. called ``KISS'' TNC [2]) was  implemented.   The  KISS  interface
  81. allowed  the host computer to completely control the TNC, without
  82. the bothersome command interface optimized for human use, and  it
  83. quickly  became  the  ``way  to  go''  to  use TCP/IP on the air.
  84. Still, it used 1200 baud Bell 202-compatible modems on the  radio
  85. side.  Indeed, the KISS TNC was never intended to be anything but
  86. a stopgap measure.
  87.  
  88.      Last year, Dale Heatherington, WA4DSY, designed a reproduci-
  89. ble 56 kilobit/sec modem [3].  With the help of Doug Drye,  KD4NC
  90. and  a  host  of  other  Georgia Radio Amateur Packet Enthusiasts
  91. Society (GRAPES) members, modem board sets, complete  schematics,
  92. board layouts and parts lists became available at very reasonable
  93. cost.  Since then, GRAPES has also made a complete 56k kit avail-
  94. able.  With the introduction of this modem, Dale needed to figure
  95. out a way to connect it  with  some  packet  radio  hardware  and
  96. software.   Since  the  TNC-1  could not handle 56k bits/sec, and
  97. because the existing TNC code for the TNC-2 was unavailable, Dale
  98. chose to perform substantial modifications to the KISS TNC-2 code
  99. to permit it to handle 56k data.  Also, since no other networking
  100. software  could  handle  the requirements of this data rate, Dale
  101. chose Karn's TCP/IP software, because it already worked with  the
  102. KISS  TNC,  and  needed  no  modifications  to run at this higher
  103. speed.  Because the TNC was essentially a  synchronous  to  asyn-
  104. chronous  converter, the 56k radio side was converted into a 19.2
  105. kbaud serial data stream and the effective throughput was limited
  106. to  only  19.2  kbaud.   This  is  how  all  56k  modems  (to our
  107. knowledge) still operate.
  108.  
  109.      What we wanted was true 56k baud system throughput, and this
  110. mandated an auxiliary I/O processor if we wanted to use the popu-
  111. lar IBM PC XT/AT/386 and Macintosh II hardware.  To be sure, four
  112. other  cards plug into the IBM XT bus, eliminating the need for a
  113. TNC: the HAPN card, the 8530-based Eagle card, the  Pac-Comm  PC-
  114. 100  and  the  DRSI card.  All of these cards are not appropriate
  115. for these higher data rates because none of  them  have  DMA  nor
  116. _________________________
  117.  
  118.   1 UNIX is a trademark of AT&T Bell Laboratories.
  119.   2 Chepponis,  M.,  and  Karn,  P., ``The KISS TNC:  A
  120. simple Host-to-TNC communications protocol,'' _A_R_R_L _A_m_a-
  121. _t_e_u_r  _R_a_d_i_o  _S_i_x_t_h  _C_o_m_p_u_t_e_r _N_e_t_w_o_r_k_i_n_g _C_o_n_f_e_r_e_n_c_e, pp.
  122. 38-43, Redondo Beach, 29 August 1987.
  123.  
  124.   3 Heatherington,  D.  A., ``A 56 Kilobaud RF Modem,''
  125. _A_R_R_L _A_m_a_t_e_u_r _R_a_d_i_o _S_i_x_t_h  _C_o_m_p_u_t_e_r  _N_e_t_w_o_r_k_i_n_g  _C_o_n_f_e_r-
  126. _e_n_c_e, pp. 68-75, Redondo Beach, 29 August 1987.
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. on-board CPUs.
  140.  
  141.      There are two other products that should be  mentioned:  the
  142. TAPR  NNC  and the PS-186.  The TAPR NNC did not take off because
  143. it was underpowered for the jobs we had intended it to  do.   The
  144. PS-186,  on  the other hand, is an excellent choice for mountain-
  145. top, solar-powered IP switches, and other uses that  require  low
  146. power consumption and several medium-speed channels.
  147.  
  148.      Our solution is particularly cost-effective.  Utilizing  the
  149. very  inexpensive  IBM  PC/XT  compatible systems available today
  150. with this I/O card costing approximately an additional  $200,  we
  151. can  provide  true  56  kilobit  performance at a very reasonable
  152. cost.  If one compares the cost of a comparable  1200  baud  sta-
  153. tion, in terms of dollars per bit per second, the 56k solution is
  154. indeed _v_e_r_y cheap!
  155.  
  156. _J_u_s_t_i_f_i_c_a_t_i_o_n
  157.  
  158.      The board consists of an NEC V40  microprocessor,  at  least
  159. one 85C30, and at least 256k DRAM, all running at 8 MHz.  The V40
  160. provides, most importantly, instruction  set  compatibility  with
  161. the  existing  IBM PC XT/AT environment (indeed, the V40 instruc-
  162. tion set is a superset of the 8088 instruction set, and  contains
  163. many instructions of the 80286 processor).  It also provides four
  164. DMA channels (these four channels are used to provide DMA for the
  165. 85C30,  allowing  for  very  low processor overhead when all four
  166. channels, 2 input and 2 output, are  running  56  kilobits,  full
  167. duplex).   There  are  three 16-bit counter/timers, 8 prioritized
  168. interrupts, and an NMI input.   In  addition,  it  provides  DRAM
  169. refresh support.  Running at 8 MHz, this chip provides ample hor-
  170. sepower to handle five more  85C30s,  for  ten  more  full-duplex
  171. channels,  using  an  interrupt-driven  scheme, for baud rates of
  172. 19,200 or less.  An additional pair of 56k channels, full duplex,
  173. can  be handled, for a total of four full-duplex 56k channels, if
  174. we forsake the low-speed channels;  in  this  case,  two  of  the
  175. full-duplex  channels  would be the standard DMA-driven ones, and
  176. the other two full-duplex channels would be interrupt-driven.
  177.  
  178.      The 85C30 is a CMOS version of the ultra-popular Zilog  8530
  179. Serial Communications Controller chip, which is well known in the
  180. Amateur community, is highly flexible and very  popular.   It  is
  181. used  in the FAD PAD, the Eagle card, the DRSI card, the Pac-Comm
  182. TNC-220 and  AEA's  PK-232.   With  on-board  digital  PLL  clock
  183. recovery, on-board baud rate generation, and multiple serial com-
  184. munications formats, it is indeed the  ``Swiss  Army  Knife''  of
  185. serial  communications  controllers.   In addition, the 85C30 can
  186. provide a single half-duplex  T1  channel  (1.544  megabits/sec),
  187. when we have modems that run at these rates.
  188.  
  189.      256k bytes of DRAM permit about 30 seconds  of  data  buffer
  190. for  a single 56k channel.  When all four 56k channels are active
  191. (two input, two  output),  this  memory  provides  more  than  15
  192. seconds  of  buffer  per  channel.   This  permits the host to be
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. relatively lax about servicing this I/O card, and still not  miss
  206. packets.   It permits full utilization of the bandwidth available
  207. with the WA4DSY 56k modems.
  208.  
  209.      If the (up to) ten extra  low-speed  channels  are  desired,
  210. provisions  are  made  on  the board for installation of AMD 7910
  211. modems, or TI 3105 modem chips.
  212.  
  213. _H_o_w _i_t _w_o_r_k_s
  214.  
  215.      Basically, the card is a separate I/O processor, a  computer
  216. on  a  board.   In  the  case of the IBM PC XT/AT/386, an 8k byte
  217. memory window is used to communicate with the host.  Several  I/O
  218. ports  are  used for configuring the device.  For example, the 8k
  219. byte memory window can be made to appear, under software control,
  220. into  any available 8k byte window in the IBM PC's address space.
  221. This is done by using an I/O port with the high-order bit being a
  222. ``memory enable'' bit, and the remaining 7 bits used as the upper
  223. 7 bits of the address of where one wants the memory to appear.
  224.  
  225.      The interface is extremely flexible.  Another I/O port has a
  226. single  bit  which  is  tied directly to the V40 reset pin.  Upon
  227. power-up, the 8k byte memory window is disabled, and the  V40  is
  228. kept  reset.   The host enables the memory and places it into the
  229. address space where it is desired.  Then it loads code  into  the
  230. 8k  byte  window, and then releases the reset pin by writing into
  231. the other host I/O port.  At this point, the V40 is running.
  232.  
  233.      With 256k bytes memory, the upper two address  bits  out  of
  234. the  V40  are  ignored.   This has the effect of mapping the 256k
  235. bytes into the V40's address space four times.  The advantage  of
  236. this  is  that  when the V40 reset wire is held high, it jumps to
  237. location FFFF0.  Since the 8k byte memory window into the host is
  238. always mapped into V40 addresses FE000 to FFFFF, it is trivial to
  239. initialize the I/O processor.  Also, since the interrupt  vectors
  240. for the V40 begin at location 00000, all of the interesting parts
  241. of the address space are made available without special tricks.
  242.  
  243.      The 8k byte window is dual-ported with the V40 and host pro-
  244. cessor.  In addition, the host always has priority when accessing
  245. this memory.  It is occasionally necessary to insert wait  states
  246. into  the  host processor's access requests, but since the V40 is
  247. mostly DMA driven by the 85C30, the host  waits  on  the  average
  248. only  two  T cycles, or 250ns at 8 MHz.  This means, for example,
  249. that a 1k byte packet can be transferred from the I/O card to the
  250. host in only 770 microseconds, on average.
  251.  
  252.      In the Macintosh II  the  situation  is  even  better.   The
  253. NuBus,  the  bus  used  on that machine, is capable of having Bus
  254. Masters.  A Bus Master can seize control of the bus, and  perform
  255. data  transfer  operations  between itself and either main memory
  256. and/or other I/O devices.  One way to think of it is as a  super-
  257. set of DMA capabilities; perhaps one could call it ``smart DMA''.
  258. The Macintosh II writes the addresses into  the  board  where  to
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. retrieve  data  (for transmitting) and where to deposit data (for
  272. receiving) and this board takes care of  the  rest!   This  means
  273. that  the  Macintosh  II  computer can be doing many more things,
  274. because it does not have to move memory  blocks  around  like  it
  275. needs to do in the IBM PC case.  It also means that the 256k byte
  276. on-board memory buffer is not required to be quite so big, as the
  277. Macintosh II main memory can be used as the buffer.
  278.  
  279.      One may ask why we didn't  use  DMA  on  the  IBM  PC  XT/AT
  280. machines.  In addition to the limited number of DMA channels, the
  281. variable latency time of DMA servicing on the IBM  machines  com-
  282. plicates  things,  such  that  we would need a very sophisticated
  283. buffering scheme if we were to be certain  that  bytes  were  not
  284. dropped  due  to  other  I/O  (especially  hard  disk  or  floppy
  285. activity) on the IBM PC's bus.
  286.  
  287. _H_o_w _t_o _u_s_e _i_t
  288.  
  289.      The I/O card is particularly easy to program.  We have iden-
  290. tified  two  classes of programming, the lowest-level driver code
  291. and the application  code,  which  makes  use  of  the  low-level
  292. drivers.
  293.  
  294.      For the low-level code, we have kept things  as  general  as
  295. possible  (practicing the Computer Science principle of ``delayed
  296. bindings'') - that is, we have fixed very little  about  how  one
  297. should  program  the card.  We have fixed two host I/O addresses,
  298. as mentioned above, one for enabling the 8k byte memory and plac-
  299. ing where desired in the host address space, and one for control-
  300. ling the V40 reset wire.  Other than that, the low-level program-
  301. mer  is  free to define how to use the 8k byte memory window.  In
  302. particular, which memory locations  are  used  to  specify  which
  303. 85C30  channels, which memory locations are used to hold pointers
  304. and length-of-packet values, etc., are all flexible.  Indeed, the
  305. entire  structure  is  flexible  from  the low-level programmer's
  306. point of view.  We do interrupt the main processor when  the  I/O
  307. card needs attention (and this interrupt is strappable so you can
  308. use a free interrupt of your host), such as when  we've  received
  309. an  incoming packet or when we've finished transmitting a packet.
  310. But, given the amount of buffering we've provided, the host  need
  311. not  respond instantaneously to this interrupt.  In addition, how
  312. the interrupt's reason is communicated to the host via the memory
  313. window is completely left up to the low-level programmer, enhanc-
  314. ing flexibility.
  315.  
  316.      For the applications programmer, three packages  are  avail-
  317. able  for  the I/O Toolkit: one for initializing the V40, one for
  318. receiving a packet and one  for  transmitting  a  packet.   These
  319. packages  interface with both Aztec C and Turbo C for the IBM PC,
  320. and with Lightspeed C and MPW C for the Macintosh II.  Of course,
  321. complete source code is provided with the Toolkit routines [4].
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337. _A_p_p_l_i_c_a_t_i_o_n_s
  338.  
  339.      We have concentrated  on  the  TCP/IP  use  in  ``standard''
  340. packet  radio,  but here are some other things we are planning to
  341. do with these cards.
  342.  
  343.      The first thing is to build a  complete  56k  network  node,
  344. based on Phil Karn's proposal [5].  Due to the stinging  loss  of
  345. 220  to  222 MHz, our options are more limited, but nevertheless,
  346. we intend to build a three-port IP switch, with channels on  .43,
  347. .902 and 1.2 GHz.  Two of these frequencies would be receive-only
  348. frequencies, and the other would be  a  transmit-only  frequency,
  349. for  one  of  the  switches.  The other switches in the set would
  350. have complimentary transmit / receive frequencies.  Such a scheme
  351. guarantees  that  no collisions would take place, and with suffi-
  352. cient link margins, would assure  perfect  transmission/reception
  353. at all nodes.
  354.  
  355.      Other uses are also  apparent.   For  instance,  full  color
  356. digital  SSTV  with  256 x 256 resolution and 6 bits each of red,
  357. green, blue takes less than 30 seconds to  transmit.  Error  free
  358. reception  is  possible,  given  that  the  picture  is  digital,
  359. transmitted with error detection and  retries.   In  TCP/IP,  the
  360. File  Transfer  Protocol  could  be  used  for pictures that must
  361. arrive error-free, or UDP, with less-overhead, could be  used  if
  362. some loss or errors could be tolerated.
  363.  
  364.      Digital voice is yet another interesting possibility.   With
  365. the Delanco-Spry DSP board or the new 320C25-based DSP board that
  366. TAPR/AMSAT is working on plugged into a PC with the I/O processor
  367. card,  audio  from  a microphone and preamp could be digitized by
  368. the DSP board, compressed, shipped via UDP on the RF  link,  then
  369. uncompressed  and  converted back to audio.  ``Voice mail'' would
  370. be a real possibility with such systems!
  371.  
  372.      The DSP board could also act as modem for the I/O card.   It
  373. would  be easy to experiment with different modems, all digitally
  374. realized within the DSP card,  choosing  the  best  one  for  the
  375. transmission medium.
  376.  
  377. _________________________
  378.  
  379.   4 Indeed, if there is one distinguishing feature com-
  380. mon  with all TCP/IP experimenters, it is the perceived
  381. duty to provide complete source code  for  _a_l_l  of  our
  382. programs,  free,  as  we  believe that others can learn
  383. from our code and can further enhance it and re-release
  384. it back to the Amateur Community, in the best spirit of
  385. Amateur Radio.
  386.   5 Karn,  P.,  ``A  High  Performance,  Collision-Free
  387. Packet Radio Network,'' _A_R_R_L _A_m_a_t_e_u_r _R_a_d_i_o  _S_i_x_t_h  _C_o_m-
  388. _p_u_t_e_r  _N_e_t_w_o_r_k_i_n_g _C_o_n_f_e_r_e_n_c_e, pp. 86-89, Redondo Beach,
  389. 29 August 1987.
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.      And we've only begun to explore the  many  applications  for
  404. this  high-speed interface...  What we hope what we have communi-
  405. cated is that _r_e_a_l 56k bits/sec allows much, much, more than sim-
  406. ply  faster  bulletin  board  access or quicker ``hunt-and-peck''
  407. ham-to-ham packet communication.  A brave new  world  of  distri-
  408. buted  networks and file systems is open to the amateur with this
  409. interface and high-speed RF data links!
  410.  
  411. _S_t_a_t_u_s _U_p_d_a_t_e_s
  412.  
  413.      Those interested in the an up-to-date status report on  this
  414. project are welcome send electronic mail via usenet or the Inter-
  415. net to mac@leg.ai.mit.edu or !pitt!aa4cg!bernie.   You  may  also
  416. dial-up host AA4CG directly at 904/795-3211 at 2400, 1200, or 300
  417. baud, eight-bits no parity.  Login as user ``packet''  and  pass-
  418. word ``radio''.
  419.  
  420. _A_c_k_n_o_w_l_e_d_g_e_m_e_n_t_s
  421.  
  422.      We would like to thank Phil Karn, KA9Q, for  suggesting  the
  423. major  features  of  this  I/O  processor, especially his comment
  424. ``Design it like an Ethernet card [6]'' We also thank  Bob  Hoff-
  425. man, N3CVL, for his expert typesetting, once again.
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453. _________________________
  454.   6 Indeed, we used the Western Digital WD8003E as  our
  455. model.
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463. 
  464.